<template>
    <div class="child">
     <h3>我是child组件(子) {{ car.name }} -- {{ car.price }}</h3>
     <son/>
    </div>
   </template>
   
   <script>
 import{inject} from 'vue'
   import son from './Son.vue'
     export default{
       name:'child',
       components:{son},
       setup(){
       let car = inject('car');
       return {car}
       }
     }
   </script>
   
   <style>
     .child{
       background-color: skyblue;
       padding: 10px;
     }
   </style>
   